Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not allow autodial to run in parallel #1804

Merged
merged 4 commits into from
Jun 13, 2023

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jun 11, 2023

Auto dial attempts to keep the number of active connections above
a configurable minimum, but dialling is slow so the dial queue can
grow quite large. If unchecked this can cause OOMs.

  • Adds a running boolean to the autodialler to prevent it running
    in parallel.
  • Adds a configurable limit for the auto dial and circuit relay reservation queue lengths
  • Adds a PeerJobQueue that extends PQueue to ensure we don't have two jobs for the same peer in a queue (e.g. when auto dialling or trying to reserve a relay slot)

Fixes #1800
Fixes ipfs/helia#143

Auto dial attempts to keep the number of active connections above
a configurable minimum, but dialling is slow so the dial queue can
grow quite large. If unchecked this can cause OOMs.

- Adds a `running` boolean to the autodialler to prevent it running
in parallel.
- Adds a configurable limit for the auto dial and circuit relay reservation queue lengths

Fixes #1800
Fixes ipfs/helia#143
@achingbrain achingbrain force-pushed the fix/do-not-allow-autodial-to-run-in-parallel branch from 6f23d51 to c8eb517 Compare June 11, 2023 14:08
@achingbrain achingbrain merged commit 775f892 into master Jun 13, 2023
@achingbrain achingbrain deleted the fix/do-not-allow-autodial-to-run-in-parallel branch June 13, 2023 06:21
@achingbrain
Copy link
Member Author

Merging because this solves a very real problem though I'd still like a review..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

JavaScript heap out of memory FATAL ERROR: heap out of memory, code from docs crashes
1 participant